package com.tanhua.locationmanager.controller;

import com.tanhua.locationmanager.service.LocationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
public class LocationController {

    @Autowired
    private LocationService locationService;

    @GetMapping(value = "/location/{id}", name = "根据Id查询位置，返回经纬度")
    public ResponseEntity QueryLocation(@PathVariable("id") Long id){
        return locationService.queryById(id);
    }

    @GetMapping(value = "/manage/users",name = "查询用户列表")
    public ResponseEntity<?> list(@RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "10") Integer pagesize) {
        return locationService.list(page,pagesize);
    }
}
